package com.cosina.test;

import java.nio.FloatBuffer;
import java.nio.IntBuffer;

import javax.microedition.khronos.opengles.GL10;

public class Lession2Render extends BaseRender{
	
	 private FloatBuffer triggerBuffer = FloatBuffer.wrap(new float[]{
			0f,1f,
			-1f,-1f,
			1f,-1f,});
	 private FloatBuffer quaterBuffer = FloatBuffer.wrap(new float[]{
				1f,2f,-1f,
				-1f,2f,-1f,
				1f,0f,-2f,
				-1f,0f,-2f,});
	@Override
	public void onDrawFrame(GL10 gl) {
		super.baseDrawFrame(gl);
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
//		gl.glTranslatef(-1.5f, 0.0f, -6.0f);
//		gl.glColor4f(1f, 1f, 1f, 1f);
//		gl.glVertexPointer(2, GL10.GL_FLOAT, 0, triggerBuffer);
//		gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);
//		gl.glFinish();
		
	    gl.glLoadIdentity();
	    gl.glTranslatef(0f, 0.0f, -1.5f);

	    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, quaterBuffer);
	    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);

	    /* Disable vertex array */
	    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
	}
}